<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<LINK rel="Bookmark" href="/favicon.ico" >
	<LINK rel="Shortcut Icon" href="/favicon.ico" />
	
	<title>项目管理系统</title>
	
	<link rel="stylesheet" type="text/css" href="/static/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="/static/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="/static/themes/demo.css">
	
	<script type="text/javascript" src="/static/themes/jquery.min.js"></script>
	<script type="text/javascript" src="/static/themes/jquery.easyui.min.js"></script>	
	<script type="text/javascript" src="/static/global.js"></script>
</head>
<body>
<!-- 添加用户窗口-->
<div style="width:460px;overflow:hidden;">

<form id="ff" class="easyui-form" method="post" data-options="novalidate:true" style="padding:3px 50px;">
	<div style="margin-bottom:10px;margin-top:10px;">
		<input class="easyui-textbox" name="employee_no" style="width:100%" data-options="label:'工&emsp;&emsp;号:',required:true">
	</div>
	<div style="margin-bottom:10px;">
		<input class="easyui-textbox" name="employee_name" style="width:100%" data-options="label:'姓&emsp;&emsp;名:',required:true">
	</div>
	<div style="margin-bottom:10px;">
		<input class="easyui-textbox" name="departs" style="width:100%" data-options="label:'部&emsp;&emsp;门:',required:true">
	</div>
	<div style="margin-bottom:10px;">
		<input class="easyui-textbox" name="departs_section" style="width:100%" data-options="label:'科&emsp;&emsp;室:',required:true">
	</div>
	<div style="margin-bottom:10px;">
		<input class="easyui-textbox" name="section_room" style="width:100%" data-options="label:'车&emsp;&emsp;间:',required:true">
	</div>
	<div style="margin-bottom:10px;">
		<input class="easyui-datebox" text="text" name="join_date" label="入职时间:"  data-options="formatter:myformatter,parser:myparser,required:true,panelWidth:220" style="width:100%;">
	</div>
	<div>
		<input class="easyui-textbox" name="memo" style="width:100%;height:100px" data-options="multiline:true,label:'备&emsp;&emsp;注:'">
	</div>
	<div style="text-align:center;">
		<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveUser()">保存</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#tt').dialog('close')">取消</a>
	</div>	
</form>	

</div>	
<script type="text/javascript">
// 添加用户
/*
function addUser(employee_id = ""){ 	
	if(employee_id == "") {
		$('#ff').form('clear');
		$('#dlg').dialog('open').dialog('setTitle','新增员工');
	} else {		
		$('#dlg').dialog('open').dialog('setTitle','修改员工');
		$('#ff').form('clear');
		$('#ff').form('load', '/index.php/index/Index/getUserData?employee_id='+employee_id);

		/*$('#ff').form('load',{
			employee_no:'myname',
			employee_name:'mymail@gmail.com',
			departs:'subject',
			departs_section:'subject',
			section_room:'message',
			join_date:'message',
			memo:'en'
		});
	};
} */


// 保存用户
function saveUser() {
	var opr = $('#opr').val();
	$('#ff').form('submit',{
		url: "/index.php/index/Index/saveEmployee?opr="+opr,
		onSubmit: function(){
			return $(this).form('enableValidation').form('validate');
		},
		success: function(result){			
			var result = eval('('+result+')');
			if (result.errorMsg){
				$.messager.show({
					title: 'Error',
					msg: result.errorMsg
				});
			} else {				
				if(opr == '0') {
					var msg = '添加成功';
				} else {
					var msg = '修改成功';
				}
				$.messager.show({
					title: 'Success',
					msg: msg
				});
				$('#dlg').dialog('close');		// close the dialog
				$('#employee_dg').datagrid('reload');	// reload the user data
			}
		}
	});
};
</script>			
</body>
</html>